#include "BieuThucTong.h"

BieuThucTong::BieuThucTong()
{
	this->k=2;
	//this->m_u=null;
	//this->m_v=null;	
}
BieuThucTong::BieuThucTong(BieuThuc *a,BieuThuc *b)
{
	this->m_u=a;
	this->m_v=b;
}
BieuThucTong::~BieuThucTong()
{
}
BieuThuc& BieuThucTong::khoitao(float *x,int i)
{
	this->k=x[i];
	i++;
	this->m_u->khoitao(x,i);
	this->m_v->khoitao(x,i);
	return *this;
}
string BieuThucTong::bieuDien()
{
	return"("+ m_u->bieuDien() + ")+(" + m_v->bieuDien()+")";
}

string BieuThucTong::bieuDienDaoHam()
{
	return "Not yet implemented";
}

float BieuThucTong::tinhDaoHam(float x)
{
	return this->m_u->tinhDaoHam(x) * this->m_v->tinhDaoHam(x);;
}

float BieuThucTong::tinhGiaTri(float x)
{
	return this->m_u->tinhGiaTri(x) * this->m_v->tinhGiaTri(x);
}